/* 
 * File:   Pad.h
 * Copyright (C) 2008
 *		J. Daniel Expósito Polo (HellSpawn)
 *		Sergio Padrino Recio (PadrinatoR)
 *
 * Created on 8 de septiembre de 2008, 19:51
 *
 * This file is part of BombProject.
 * 
 * BombProject is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
   
 * BombProject is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with BombProject.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _PAD_H
#define	_PAD_H

#include "InputDevice.h"
#include <SDL/SDL_joystick.h>

/**
 * This class represents a Keyboard.
 * @see InputHandler
 */
class Pad : public InputDevice {
private:
	Uint16 mNumAxes;
	Uint16 mNumRegularButtons;
	Uint16 mNumHats;
	const char *mPadName;
	SDL_Joystick *mJoystick;

public:
	Pad(Uint16 index);
	~Pad();
	
	void init();
	
	ButtonState* getLinkFromPressedButton(DeviceButtonInfo& button_info);
	ButtonState* getLinkFromButtonCode(Uint16 button_code);
	
	void update();
	
	void destroy();
};


#endif	/* _PAD_H */

